home *** CD-ROM | disk | FTP | other *** search
/ Business Assistant / Business Assistant.iso / acctg / dbbills / entrtask.prg < prev    next >
Text File  |  1986-11-10  |  2KB  |  94 lines

  1. *--[ entrtask.prg ]-- enter task accomplishments
  2. CLEAR
  3. SELECT 1
  4. USE client INDEX cltcode ALIAS clt
  5. SELECT 2
  6. SET DATE ANSI
  7. USE taskunit INDEX taskdate ALIAS task
  8. STORE 0 TO m_cost,m_fee,fees,m_client
  9. m_date=DATE()
  10. DO WHILE .T.
  11.     SET COLOR TO W+
  12.     @ 1,32 SAY "TASK DATA ENTRY"
  13.     SET COLOR TO W
  14.     @ 2,0 SAY "-------------------------------------------------------------------------------"
  15.     SET COLOR TO W+
  16.     @ 3,0 SAY "CLT    DATE    BEGIN  END   DESCRIPTION OF TASK            CH HOURS FEE  BILLED"
  17.     @ 22,15 SAY "Leave the CLT field empty to chage date or exit to menu."
  18.     SET COLOR TO W
  19.     line=4
  20.     DO WHILE .T.
  21.         @ line,0
  22.         m_client=0
  23.         @ line,0 GET m_client PICTURE "###"
  24.         READ
  25.         IF m_client=0
  26.             m_date=DATE()
  27.             @ 23,15 SAY "ENTER ANOTHER DATE OR ^Y TO FINISH "
  28.             SET DATE AMERICAN
  29.             @ 23,COL() GET m_date
  30.             READ
  31.             @ 23,0
  32.             IF DTOC(m_date)="  /  /  "
  33.                 @ 21,0 CLEAR
  34.                 @ 21,65 SAY "------- -------"
  35.                 @ 22,50 SAY "TOTALS"
  36.                 @ 22,65 SAY STR(m_cost,7,2)
  37.                 @ 22,72 SAY STR(fees,7,2)
  38.                 WAIT "               PRESS RETURN AFTER READING SCREEN"
  39.                 CLEAR
  40.                 RETURN
  41.             ELSE
  42.                 SET DATE ANSI
  43.                 LOOP
  44.             ENDIF no date
  45.         ELSE
  46.             SET DATE ANSI
  47.             SELECT clt
  48.             SEEK m_client
  49.             IF .NOT. FOUND()
  50.                 SET COLOR TO W*+
  51.                 @ 22,15 SAY "CLIENT NOT VALID - TRY AGAIN"
  52.                 SET COLOR TO W
  53.                 WAIT "               PRESS RETURN TO CONTINUE"
  54.                 @ 22,0 CLEAR
  55.                 m_client=0
  56.                 SELECT task
  57.                 LOOP
  58.             ENDIF .NOT. FOUND()
  59.             SELECT task
  60.             APPEND BLANK
  61.             REPLACE c_code WITH clt->c_code,taskdate WITH m_date,charge With .Y.
  62.         ENDIF m_start="    "
  63.         SET DATE AMERICAN
  64.         @ line,5 GET taskdate
  65.         @ line,15 GET start PICTURE "@R ##:##"
  66.         @ line,21 GET finish PICTURE "@R ##:##"
  67.         @ line,27 GET descriptn PICTURE "!XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  68.         @ line,59 GET charge PICTURE "@L"
  69.         READ
  70.         SET DATE ANSI
  71.         time_on=VAL(SUBSTR(start,1,2))+VAL(SUBSTR(start,3,2))/60
  72.         time_off=VAL(SUBSTR(finish,1,2))+VAL(SUBSTR(finish,3,2))/60
  73.         IF time_on>time_off
  74.             SET COLOR TO W*+
  75.             @ 23,15 SAY "INVALID ON AND OFF TIME - TRY AGAIN"
  76.             SET COLOR TO W
  77.             @ 23,0
  78.             LOOP
  79.         ENDIF
  80.         REPLACE hours WITH time_off-time_on
  81.         m_fee=hours*clt->rate
  82.         @ line,61 SAY STR(hours,4,1)
  83.         @ line,66 SAY STR(m_fee,6,2)
  84.         m_cost=m_cost+m_fee
  85.         IF charge
  86.             @ line,73 SAY STR(m_fee,6,2)
  87.             fees=fees+m_fee
  88.         ENDIF charge
  89.         line=line+1
  90.         line=IIF(line=21,3,line)
  91.     ENDDO WHILE .T.
  92. ENDDO WHILE .T.
  93. RETURN
  94.